﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarbonExchange.Bll
{
    public class ItemBase
    {
        public object CID { get; internal set; }


        public void EnsureConcurent(object concurencyId)
        {
            if (!CheckConcurent(concurencyId))
            {
                throw new Exceptions.ConcurencyException();
            }
        }

        public bool CheckConcurent(object concurencyId)
        {
            if (CID != null)
            {
                return CID.Equals(concurencyId);
            }
            else
            {
                return true;
            }
        }
    }
}
